package com.weibiao.zhuhai.algorithm;

public class Test {
	public static void main(String[] args) {
        int[] bookValue = {5,30,50};
//        float [] bookValue = {0.5,3.0,5.0};
        int m = bookValue.length-1;
        int bookNum = 100000;
        int n =100000000;
        int count = 0;
        int times =test(n, bookValue, m, bookNum,count);
        System.out.println(times);
    }
	public static int test(int n, int[] bookValue, int m, int bookNum, int count){
		if(n >= 0 & count == 10000000) {
			return 1;
		}
		if(n <0) {
			return 0;
		}
		if(m <0) {
			return 0;
		}
		if(count >100000) {
			return 0;
		}
		int times_temp = 0;
		for(int i = 0; i <=bookNum; i++) {
			times_temp = times_temp +test(n-i*bookValue[m], bookValue, m-1, bookNum, count+i);
		}
		return times_temp;
	}
}
